package com.sgb.kjwl.view.ui.adapter.enterprise;

import androidx.annotation.Nullable;
import androidx.databinding.DataBindingUtil;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.sgb.kjwl.BR;
import com.sgb.kjwl.R;
import com.sgb.kjwl.databinding.ItemCarHallSubVideoBinding;
import com.swgk.core.base.model.entity.VideoBean;

import java.util.List;

/**
 * Time:2021/5/25
 * Author:黄淋
 * Description:服务首页视频适配
 */
public class VideoHallAdapter extends BaseQuickAdapter<VideoBean, BaseViewHolder> {

    public VideoHallAdapter(@Nullable List<VideoBean> data) {
        super(R.layout.item_car_hall_sub_video, data);
    }

    @Override
    protected void convert(BaseViewHolder helper, VideoBean entity) {
        //设置dataBinding数据
        ItemCarHallSubVideoBinding binding = DataBindingUtil.bind(helper.itemView);
        if (binding == null) return;
        binding.setVariable(BR.viewModel, entity);
        binding.executePendingBindings();
    }
}